home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 010 / golfscr.arc / GOLFCARD.BAS < prev    next >
BASIC Source File  |  1986-06-10  |  53KB  |  817 lines

  1. 10 KEY OFF:CLS
  2. 20 DEFINT A - Z:CC$="*"
  3. 30 DIM P(50),P$(50),TN$(50),S$(20),S(50,20),GAMTOT(50),AVG!(50),MONTOT(50),PLYR$(50),PLYR(50),ST(20),R(50),MONEY(50),GAMDIG(50),MONDIG(50),T(20),SCORTOT(50),GMTOT(50),P3HTOT(50),P3STOT(50),P4HTOT(50),P4STOT(50),P5HTOT(50),P5STOT(50),P3AVG!(50)
  4. 35 DIM P4AVG!(50),P5AVG!(50)
  5. 40 ON ERROR GOTO 33000
  6. 1000 CLOSE:REM****************************************MAIN MENU
  7. 1010 GOSUB 26000:LOCATE 7,20:PRINT"HERE'S WHAT WE CAN DO FOR YOU:":LOCATE 9,25:PRINT"1.  Input Information":LOCATE 10,25:PRINT"2.  Modify Information":LOCATE 11,25
  8. 1080 PRINT"3.  Display Information":LOCATE 12,25:PRINT"4.  Print Information":LOCATE 13,25:PRINT"5.  Initialize Diskette":LOCATE 14,25:PRINT"6.  End Program"
  9. 1110 LOCATE 20,20:INPUT"Please type the number of your choice. ",A
  10. 1140 ON A GOTO 2000,3000,4000,28000,1400,32000
  11. 1150 BEEP:GOTO 1110
  12. 1400 REM****************************************INITIALIZE DISKETTE
  13. 1410 CLS:PRINT"This routine prepares the diskette in the default drive to use the"
  14. 1420 PRINT"GOLFCARD program.  It must be run before GOLFCARD is used for the":PRINT"first time."
  15. 1430 PRINT:PRINT"If the diskette in the default drive has already been used with"
  16. 1440 PRINT"the GOLFCARD program, this routine will wipe out any data entered."
  17. 1450 PRINT:PRINT"Do you want to proceed with the initialization routine?"
  18. 1460 PRINT"(Type `Y' or `N') ";
  19. 1465 INPUT"",A$
  20. 1470 IF A$ = "Y" OR A$ = "y" THEN 1500
  21. 1480 IF A$ = "N" OR A$ = "n" THEN 1000
  22. 1490 BEEP:PRINT"Please type `Y' or `N'. ";:GOTO 1465
  23. 1500 PRINT:PRINT:PRINT SPC(24);:COLOR 0,7:PRINT" WARNING: DATA WILL BE DESTROYED ":COLOR 7,0:BEEP:BEEP:BEEP
  24. 1510 PRINT:PRINT:PRINT"Press `I' to run initialization routine.  Press any other"
  25. 1520 PRINT"key to return to Main Menu. "
  26. 1530 A$ = INKEY$
  27. 1540 IF A$ = "" THEN 1530
  28. 1550 IF A$ <> "I" AND A$ <> "i" THEN 1000
  29. 1555 CLS:LOCATE 10,30:PRINT"One moment please....."
  30. 1560 OPEN "course.dat" FOR OUTPUT AS #1:CLOSE #1:KILL "course.dat":OPEN "COURSE.DAT" FOR OUTPUT AS #1: CLOSE #1
  31. 1570 OPEN "round.dat" FOR OUTPUT AS #1:CLOSE #1:KILL "round.dat":OPEN "ROUND.DAT" FOR OUTPUT AS #1: CLOSE #1
  32. 1580 OPEN "golfers.dat" FOR OUTPUT AS #1:CLOSE #1:KILL "golfers.dat":OPEN "GOLFERS.DAT" FOR OUTPUT AS #1: CLOSE #1
  33. 1590 OPEN "golfptr.dat" FOR OUTPUT AS #1:PRINT #1,0:CLOSE #1:OPEN "coursptr.dat" FOR OUTPUT AS #1:PRINT #1,0:CLOSE #1:OPEN "roundptr.dat" FOR OUTPUT AS #1:PRINT #1,0:CLOSE #1: GOTO 1000
  34. 2000 CLOSE:REM****************************************INPUT MENU
  35. 2010 GOSUB 26000:LOCATE 7,20:PRINT"HERE'S WHAT YOU CAN INPUT:":LOCATE 9,25:PRINT"1.  New Golfer(s)":LOCATE 11,25:PRINT"2.  New Course":LOCATE 13,25:PRINT"3.  Game Results":LOCATE 15,25:PRINT"4.  Return to Main Menu"
  36. 2120 LOCATE 20,20:INPUT"Please type the number of your choice. ",A
  37. 2140 ON A GOTO 5000,6000,7000,1000
  38. 2150 BEEP:GOTO 2120
  39. 3000 REM****************************************MODIFICATION MENU
  40. 3010 GOSUB 26000
  41. 3020 LOCATE 7,20:PRINT"HERE'S WHAT YOU CAN MODIFY:":LOCATE 9,25:PRINT"1.  Player Name":LOCATE 11,25:PRINT"2.  Course Name":LOCATE 13,25:PRINT"3.  Course Pars":LOCATE 15,25:PRINT"4.  Game Results":LOCATE 17,25:PRINT"5.  Return to Main Menu"
  42. 3140 LOCATE 20,20:INPUT"Please type the number of your choice. ",A
  43. 3160 ON A GOTO 10000,11000,12000,13000,1000
  44. 3170 BEEP:GOTO 3140
  45. 4000 CLOSE:REM****************************************DISPLAY MENU
  46. 4025 GOSUB 26000:LOCATE 7,20:PRINT"HERE'S THE INFORMATION YOU CAN HAVE DISPLAYED":GOSUB 4030:GOTO 4200
  47. 4030 LOCATE 9,25:PRINT"1.  List of registered golfers
  48. 4040 LOCATE 10,25:PRINT"2.  All players' averages":LOCATE 11,25:PRINT"3.  All players' winnings/losses":LOCATE 12,25:PRINT"4.  All players' hole averages by par":LOCATE 13,25:PRINT"5.  Individual player's average for any course":LOCATE 14,25
  49. 4041 PRINT"6.  Individual player's hole averages by par":LOCATE 15,25:PRINT"7.  Individual player's rounds to date":LOCATE 16,25:PRINT"8.  Course data":LOCATE 17,25:PRINT"9.  Individual game":LOCATE 18,24:PRINT"10.  Return to Main Menu":RETURN
  50. 4200 LOCATE 20,20:INPUT"Please type the number of your choice. ",A
  51. 4220 ON A GOTO 14000,15000,16000,30100,17000,18000,19000,20000,30000,1000
  52. 4230 BEEP:GOTO 4200
  53. 5000 REM***************************************INPUT NEW GOLFERS
  54. 5001 OPEN "GOLFPTR.DAT" FOR INPUT AS #1:INPUT #1,N:CLOSE #1:IF N<48 THEN 5005
  55. 5003 CLS:PRINT"Sorry, there are already 48 golfers registered.":PRINT:PRINT"If you would like to substitute a new player for any existing player who":PRINT"has not already played, you may do so by using the MODIFICATION option."
  56. 5004 PRINT:PRINT:GOTO 27000
  57. 5005 CLS:LOCATE 5,1:GOSUB 5010:GOTO 1000
  58. 5010 PRINT"All new golfers must register.":PRINT:PRINT"Please provide golfers' names as you would like them listed in our":PRINT"official records.  Our membership can go up to 48, but please":PRINT"do not register more than 10 golfers at one time."
  59. 5020 PRINT:PRINT
  60. 5070                REM***********************************OBTAIN GOLFERS' NAMES
  61. 5086 IF N<39 THEN L=10:GOTO 5090
  62. 5087 L=48-N
  63. 5090 K=1
  64. 5110 LOCATE 25,1:PRINT"Type `END' when finished.";:LOCATE 14,15:PRINT" _______________":LOCATE 14,1
  65. 5120 INPUT "Golfer's name: ",N$(K)
  66. 5130 IF LEN (N$(K))>15 THEN CLS:LOCATE 5,1:PRINT"Sorry, that name is too long.  Please shorten":PRINT"the name to fit on the dashed line (15 characters).":GOTO 5110
  67. 5140 IF N$(K) <> "end" AND N$(K) <>"End" AND N$(K) <> "END" AND K<L THEN K = K+1:CLS:LOCATE 12,1:GOTO 5110
  68. 5150 IF N$(K) <> "end" AND N$(K) <>"End" AND N$(K) <> "END"  THEN K = K+1
  69. 5160 IF K = 1 THEN 1000
  70. 5170                REM****************************************CHECK NAMES
  71. 5200 CLS:FOR I=1 TO K-1:IF I>9 THEN PRINT I;CHR$(29);".  " N$(I):GOTO 5230
  72. 5210 PRINT " ";I;CHR$(29);".  " N$(I):NEXT I
  73. 5230 PRINT:PRINT:PRINT "Are these names correct?  (Type `Y' or `N') ";
  74. 5240 INPUT"",A$
  75. 5250 IF A$ = "y" OR A$ ="Y" THEN 5350
  76. 5260 IF A$="n" OR A$ = "N" THEN 5280
  77. 5270 BEEP:PRINT"Please type `Y' or `N'. ";:GOTO 5240
  78. 5280                REM****************************************CORRECT NAMES
  79. 5290 PRINT:INPUT "Which line would you like to change";LN
  80. 5300 IF LN<1 OR LN>(K-1) THEN PRINT"Wrong number.....please try again.":GOTO 5290
  81. 5320 CLS:LOCATE 3,1:PRINT"It currently reads: ";N$(LN)
  82. 5330 PRINT "It should read: ";:LOCATE 4,17:FOR I = 1 TO 15:PRINT"_";:NEXT I:LOCATE 4,1:INPUT "It should read: ",NN$
  83. 5340 IF LEN (NN$)>15 THEN LOCATE 6,1:PRINT"Sorry, that name is too long.  Please shorten":PRINT"the name to fit on the dashed line (15 characters).":FOR P=1 TO 30:FOR I = 1 TO 3000:NEXT I:NEXT P:GOTO 5320
  84. 5348 N$(LN)=NN$:GOTO 5200
  85. 5350 OPEN "golfptr.dat" FOR INPUT AS #1:INPUT #1,GOLFERS:CLOSE #1:GOLFERS=GOLFERS+K-1:OPEN "golfptr.dat" FOR OUTPUT AS #1:PRINT #1,GOLFERS:CLOSE #1:OPEN "golfers.dat" FOR APPEND AS #4:FOR I = 1 TO K-1:PRINT #4,N$(I):NEXT I:RETURN
  86. 6000 REM****************************************INPUT NEW COURSE
  87. 6010 GOSUB 6030:GOTO 1000
  88. 6030 CLS:PRINT"Do you want to enter information about a new golf course?"
  89. 6040 PRINT"(Type `Y' or `N') ";
  90. 6050 INPUT"",A$
  91. 6060 IF A$ = "y" OR A$ ="Y" THEN 6090
  92. 6070 IF A$="n" OR A$ = "N" THEN 1000
  93. 6080 BEEP:PRINT"Please type `Y' or `N'. ";:GOTO 6050
  94. 6090 CLS:LOCATE 1,33:FOR I = 1 TO 26:PRINT"_";:NEXT I:LOCATE 1,1:PRINT"What is the name of the course?":PRINT:PRINT"PLEASE NOTE: If you would like the scores from this course to be"
  95. 6091 PRINT"automatically excluded from calculations of player averages, type":PRINT"an asterisk (*) as the first or last character in the course name."
  96. 6158 LOCATE 1,33:INPUT"",CORS$:IF CORS$="" THEN 6158
  97. 6160 IF LEN (CORS$)>26 THEN LOCATE 8,1:PRINT"Sorry, that name is too long.  Please shorten":PRINT"the name to fit on the dashed line (26 characters).":FOR P=1 TO 30:FOR I = 1 TO 3000:NEXT I:NEXT P:GOTO 6090
  98. 6170 LOCATE 10,1:PRINT"Please enter PAR for each hole."
  99. 6180 FOR I = 1 TO 9
  100. 6190 LOCATE 12+I:PRINT"Hole";I;CHR$(29);": ";:INPUT "",P(I):NEXT I
  101. 6200 FOR I = 10 TO 18:LOCATE 3+I,40:PRINT"Hole";I;CHR$(29);": ";:INPUT"",P(I):NEXT I
  102. 6210 CLS:GOSUB 24000:LOCATE 17,1
  103. 6230 PRINT "Is this information correct?  (Type `Y' or `N') ";
  104. 6240 INPUT"",A$:A$=MID$(A$,1,1)
  105. 6250 IF A$ = "y" OR A$ ="Y" THEN 6470
  106. 6260 IF A$="n" OR A$ = "N" THEN 6280
  107. 6270 BEEP:LOCATE 17,49:FOR I=1 TO 32:PRINT" ";:NEXT I:LOCATE 17,56:PRINT"`Y' or `N', please: ";:GOTO 6240
  108. 6280 PRINT"Is the name correct?  (Type `Y' or `N') ";
  109. 6290 INPUT"",A$:A$=MID$(A$,1,1)
  110. 6300 IF A$ = "y" OR A$ ="Y" THEN 6420
  111. 6310 IF A$="n" OR A$ = "N" THEN 6330
  112. 6320 BEEP:LOCATE 18,41:FOR I=1 TO 40:PRINT" ";:NEXT I:LOCATE 18,56:PRINT"`Y' or `N', please: ";:GOTO 6290
  113. 6330 LOCATE 20,1:PRINT"Old name = ";CORS$
  114. 6340 LOCATE 21,12:FOR I = 1 TO 26: PRINT"_";:NEXT I:LOCATE 21,1
  115. 6350 INPUT "New name = ",NC$
  116. 6360 IF LEN(NC$)>26 THEN LOCATE 22,1:PRINT"Sorry, that name is too long.  Please shorten":PRINT"the name to fit on the dashed line (26 characters).":FOR P=1 TO 30:FOR I = 1 TO 3000:NEXT I:NEXT P:GOTO 6380
  117. 6370 CORS$=NC$:GOTO 6210
  118. 6380 FOR I=20 TO 24:LOCATE I,1:FOR P=1 TO 79:PRINT" ";:NEXT P:NEXT I:GOTO 6330
  119. 6420 INPUT "Which hole is incorrect";H
  120. 6430 IF H<1 OR H>18 THEN PRINT"Please type a number from 1 to 18":GOTO 6420
  121. 6440 PRINT"Old par =";P(H):INPUT "New par = ",P(H)
  122. 6460 GOTO 6210
  123. 6470 OPEN "coursptr.dat" FOR INPUT AS #1:INPUT #1,L:L= L+1:CLOSE #1
  124. 6480 OPEN "COURSPTR.DAT" FOR OUTPUT AS #1:PRINT #1,L:CLOSE #1
  125. 6500 OPEN "COURSE.DAT" AS #2 LEN=62
  126. 6510 FIELD #2,26 AS COURSE$,2 AS P$(1),2 AS P$(2),2 AS P$(3),2 AS P$(4),2 AS P$(5),2 AS P$(6),2 AS P$(7),2 AS P$(8),2 AS P$(9),2 AS P$(10),2 AS P$(11),2 AS P$(12),2 AS P$(13),2 AS P$(14),2 AS P$(15),2 AS P$(16),2 AS P$(17),2 AS P$(18)
  127. 6520 LSET COURSE$ = CORS$:FOR I = 1 TO 18:LSET P$(I)=MKI$(P(I)):NEXT I:PUT #2,L
  128. 6560 RETURN
  129. 7000 REM****************************************INPUT GAME RESULTS
  130. 7010 CLS:PRINT"Do you want to enter game results?"
  131. 7020 PRINT"(Type `Y' or `N') ";
  132. 7030 INPUT"",A$
  133. 7040 IF A$ = "y" OR A$ ="Y" THEN PRINT:GOSUB 25000:GOTO 7070
  134. 7050 IF A$="n" OR A$ = "N" THEN 1000
  135. 7060 BEEP:PRINT"Please type `Y' or `N'. ";:GOTO 7030
  136. 7070 CLS:OPEN "COURSPTR.DAT" FOR INPUT AS #1
  137. 7080 INPUT #1,L:IF L = 0 THEN PRINT"Sorry, there are no courses listed in our files.  Before proceeding,":PRINT"you must go to the Course Entry section and enter a course.":LOCATE 25,1:GOTO 27000
  138. 7100 CLOSE #1:OPEN "COURSE.DAT" AS #2 LEN = 62
  139. 7110 FIELD #2,26 AS COURSE$,2 AS P$(1),2 AS P$(2),2 AS P$(3),2 AS P$(4),2 AS P$(5),2 AS P$(6),2 AS P$(7),2 AS P$(8),2 AS P$(9),2 AS P$(10),2 AS P$(11),2 AS P$(12),2 AS P$(13),2 AS P$(14),2 AS P$(15),2 AS P$(16),2 AS P$(17),2 AS P$(18)
  140. 7120 Y = L/2:FOR I = 1 TO Y:GET #2,I:IF I>9 THEN PRINT I;CHR$(29);".  ";COURSE$:GOTO 7170
  141. 7160 PRINT " ";I;CHR$(29);".  ";COURSE$
  142. 7170 NEXT I:FOR I = (Y+1) TO L:GET #2,I:LOCATE (I-Y),40:IF I>9 THEN PRINT I;CHR$(29);".  ";COURSE$:GOTO 7230
  143. 7220 PRINT " ";I;CHR$(29);".  ";COURSE$
  144. 7230 NEXT I:IF (L+1)/2 = Y THEN PRINT
  145. 7240 PRINT:PRINT:PRINT"What course number, please?  (If course doesn't appear on this list, enter `99'.This will allow you to enter the course into our files.)  ";
  146. 7245 INPUT"",CORS
  147. 7250 IF CORS = 99 THEN CLOSE:GOSUB 6030:CLOSE:GOTO 7000
  148. 7260 IF CORS<1 OR CORS>L THEN PRINT:PRINT"Wrong number.....try again.  ";:PRINT"What course number, please? ";:GOTO 7245
  149. 7270 GET #2,CORS
  150. 7280 FRONTP = 0:BACKP = 0:FOR I = 1 TO 9:FRONTP = FRONTP + CVI(P$(I)):NEXT I:FOR I = 10 TO 18:BACKP = BACKP +CVI(P$(I)):NEXT I:TOTP = FRONTP + BACKP
  151. 7320 CLS:INPUT"How many players? ",PLYRS
  152. 7330 IF PLYRS<1 THEN BEEP:GOTO 7320
  153. 7340 CLS:GOSUB 22000:IF K<>0 THEN 7350
  154. 7345 PRINT"Do you want to enter players' names?  (Type `Y' or `N'.) ";
  155. 7346 INPUT"",A$
  156. 7347 IF A$="Y" OR A$="y" THEN GOSUB 5010:CLOSE:GOTO 7000
  157. 7348 IF A$="N" OR A$="n" THEN 1000
  158. 7349 BEEP:PRINT"Please type `Y' or `N'. ";:GOTO 7346
  159. 7350 PRINT:PRINT:FOR M = 1 TO PLYRS
  160. 7360 PRINT:PRINT"Select Player ";CHR$(29);M;:INPUT"please: ",PLYR(M)
  161. 7370 IF PLYR(M)<1 OR PLYR(M) >K THEN PRINT"Wrong number.....try again.   ";:GOTO 7360
  162. 7390 NEXT M:CLS:PRINT"Course: ";COURSE$:PRINT:FOR M = 1 TO PLYRS:PRINT"Player";M;CHR$(29);": ";TN$(PLYR(M)):NEXT M:PRINT
  163. 7450 PRINT"Please enter the amount of money (in even dollars) that each player"
  164. 7460 PRINT"won or lost.  Indicate a loss by a negative number.  If no money":PRINT"was won or lost, enter `0'.":PRINT:FOR M = 1 TO PLYRS
  165. 7490 PRINT"How much did ";TN$(PLYR(M)) ;:INPUT" win or lose";MONEY(M):NEXT M:FOR M =1 TO PLYRS:PRINT:PRINT TN$(PLYR(M));":":FOR I = 1 TO 18
  166. 7540 IF I<10 THEN PRINT "     Hole";I;:INPUT" score: ",S(M,I):GOTO 7560
  167. 7550 PRINT "     Hole";I;:INPUT"score: ",S(M,I)
  168. 7560 NEXT I:NEXT M:GOSUB 7600:GOTO 8910
  169. 7600 GOSUB 7605:GOTO 7900
  170. 7605 CLS:PRINT COURSE$;"   (";FRONTP;"/";BACKP;"/";TOTP;")":LOCATE 1,73:PRINT DT$
  171. 7620 PRINT"               Hole  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18  TOTAL";
  172. 7630 PRINT:PRINT"                Par ";:PARTOT = 0
  173. 7640 FOR I = 1 TO 18:PRINT CVI(P$(I));:PARTOT = PARTOT + CVI(P$(I)):NEXT I:PRINT "  ";PARTOT:PRINT:FOR M = 1 TO PLYRS:IF PLYRS>4 THEN D=PLYRS+1 ELSE D=5
  174. 7680 LOCATE M+5,1:PRINT M;CHR$(29);". ";TN$(PLYR(M));:LOCATE M+5,21
  175. 7690 TOT=0:FOR I = 1 TO 18:TOT = TOT + S(M,I):IF S(M,I)<10 THEN PRINT S(M,I);:GOTO 7760
  176. 7700 PRINT CHR$(29);S(M,I);
  177. 7760 NEXT I:IF TOT < 100 THEN PRINT " ";
  178. 7770 PRINT" ";TOT:NEXT M:LOCATE 6+D,1:FOR M=1 TO PLYRS:PRINT TN$(PLYR(M));
  179. 7820 IF MONEY(M) = 0 THEN PRINT" neither won nor lost any money.":GOTO 7890
  180. 7830 IF MONEY(M)<0 THEN 7860 ELSE PRINT" won";MONEY(M);
  181. 7840 IF MONEY(M)<2 THEN PRINT"dollar.":GOTO 7890
  182. 7850 PRINT"dollars.":GOTO 7890
  183. 7860 PRINT" lost";0-MONEY(M);
  184. 7870 IF MONEY(M)>-2 THEN PRINT"dollar.":GOTO 7890
  185. 7880 PRINT"dollars."
  186. 7890 NEXT M
  187. 7895 RETURN
  188. 7900                REM*************************************CHECK INFORMATION
  189. 7910 IF PLYRS <5 THEN LOCATE 16,1 ELSE PRINT
  190. 7920 PRINT"Is all of the above information accurate?     ";
  191. 7930 PRINT"(Type `Y' or `N') ";
  192. 7940 INPUT"",A$
  193. 7950 IF A$="Y" OR A$ ="y" THEN GOTO 7980
  194. 7960 IF A$= "N" OR A$ = "n" THEN 8060
  195. 7970 BEEP:PRINT"Please type `Y' or `N'. ";:GOTO 7940
  196. 7980 PRINT"Are you sure?     ";
  197. 7990 PRINT"(Type `Y' or `N') ";
  198. 8000 INPUT"",A$
  199. 8010 IF A$="Y" OR A$ ="y" THEN GOTO 8900
  200. 8020 IF A$= "N" OR A$ = "n" THEN 8040
  201. 8030 BEEP:PRINT"Please type `Y' or `N'. ";:GOTO 8000
  202. 8040 IF PLYRS<5 THEN LOCATE 17,1:FOR I = 1 TO 80:PRINT" ";:NEXT I:GOTO 7900
  203. 8050 GOTO 7600
  204. 8060 IF PLYRS>4 THEN 8100
  205. 8070 LOCATE 16,1:FOR I = 1 TO 160:PRINT" ";:NEXT I:LOCATE 16,1
  206. 8100 PRINT"You have the following options:":IF ZZZ = 999 THEN 8270
  207. 8120 PRINT:PRINT"     1.  Start all over again                 4.  Change a player's name
  208. 8130 PRINT"     2.  Change the course name               5.  Change a score
  209. 8140 PRINT"     3.  Change the date                      6.  Change a money entry
  210. 8150 PRINT"             7.  Make no changes -- it's all accurate after all
  211. 8160 PRINT SPC(79):PRINT"Please type the number of your choice. ";
  212. 8170 INPUT"",A
  213. 8180 ON A GOTO 8210,8420,8220,8660,8750,8840,8400
  214. 8190 BEEP:PRINT"Wrong number, please try again. ";:GOTO 8170
  215. 8210 CLOSE:GOTO 7000
  216. 8220 CLS:GOSUB 25000:GOTO 7600
  217. 8260 GOTO 7980
  218. 8270 PRINT
  219. 8280 PRINT"     1.  Change the course name               4.  Change a score
  220. 8290 PRINT"     2.  Change the date                      5.  Change a money entry
  221. 8300 PRINT"     3.  Change a player's name               6.  Make no changes after all
  222. 8310 PRINT:PRINT"Please type the number of your choice. ";
  223. 8320 INPUT"",A
  224. 8330 ON A GOTO 8420,8360,8660,8750,8840,8400
  225. 8340 BEEP:PRINT"Wrong number, please try again. ";:GOTO 8320
  226. 8360 GOSUB 25000:GOTO 7600
  227. 8400 IF PLYRS < 5 THEN GOSUB 21000:GOTO 7900
  228. 8410 GOTO 7980
  229. 8420                     REM***********************************CHANGE COURSE
  230. 8430 CLS:Y = L/2:FOR I = 1 TO Y:GET #2,I
  231. 8470 IF I>9 THEN PRINT I;CHR$(29);".  ";COURSE$:GOTO 8490
  232. 8480 PRINT " ";I;CHR$(29);".  ";COURSE$
  233. 8490 NEXT I
  234. 8500 FOR I = (Y+1) TO L:GET #2,I:LOCATE (I-Y),40
  235. 8530 IF I>9 THEN PRINT I;CHR$(29);".  ";COURSE$:GOTO 8550
  236. 8540 PRINT " ";I;CHR$(29);".  ";COURSE$
  237. 8550 NEXT I
  238. 8560 PRINT:PRINT:PRINT"Please enter the course number from the above list."
  239. 8570 PRINT"If the course does not appear on the list, enter `99'.  This"
  240. 8580 PRINT"will allow you to enter the course into our files, but you will"
  241. 8590 IF ZZZ<>999 THEN PRINT"have to start the score input procedure over from the beginning. ";:GOTO 8600
  242. 8595 PRINT"have to start the score modification procedure over from the beginning. ";
  243. 8600 INPUT "",CORS
  244. 8610 IF CORS = 99 THEN CLOSE #2:GOSUB 6030:CORS = L
  245. 8620 IF CORS <1 OR CORS >L THEN PRINT:PRINT"Wrong number.....please try again. ";:GOTO 8600
  246. 8630 GET #2,CORS
  247. 8640 FRONTP = 0:BACKP = 0:FOR I = 1 TO 9:FRONTP = FRONTP + CVI(P$(I)):NEXT I:FOR I = 10 TO 18:BACKP = BACKP +CVI(P$(I)):NEXT I:TOTP = FRONTP + BACKP
  248. 8650 GOTO 7600
  249. 8660                     REM***********************************CHANGE PLAYER
  250. 8670 CLS:FOR I = 1 TO PLYRS:PRINT"Player";I;CHR$(29);": ";TN$(PLYR(I)):NEXT I
  251. 8680 PRINT:INPUT"Please enter the number of the player to be changed. ",M
  252. 8690 IF M<1 OR M>PLYRS THEN PRINT"Wrong number.....please try again.":GOTO 8680
  253. 8700 CLS:CLOSE #4:GOSUB 22000
  254. 8710 PRINT:PRINT
  255. 8720 PRINT"Select the number of the player above to be substituted for Player";M;CHR$(29);:INPUT": ",PLYR(M)
  256. 8730 IF PLYR(M)<1 OR PLYR(M)>K THEN PRINT"Wrong number.....please try again.":PRINT:GOTO 8720
  257. 8740 GOTO 7600
  258. 8750                 REM****************************************CHANGE SCORE
  259. 8760 GOSUB 21000:LOCATE 16,1
  260. 8770 INPUT"Whose score would you like to change?  Please type the player's number: ",M
  261. 8780 IF M<1 OR M>PLYRS THEN LOCATE 18,1:PRINT "Wrong number.....please try again.":FOR P=1 TO 30:FOR T= 1 TO 3000:NEXT T:NEXT P:LOCATE 16,1:FOR N = 1 TO 80:PRINT" ";:NEXT N:LOCATE 18,1:FOR N=1 TO 80:PRINT" ";:NEXT N:GOTO 8760
  262. 8790 LOCATE 18,1
  263. 8800 INPUT"What hole would you like to change";I
  264. 8810 IF I<1 OR I>18 THEN LOCATE 20,1:PRINT"Wrong number.....please try again.":FOR P=1 TO 30:FOR T = 1 TO 3000:NEXT T:NEXT P:LOCATE 18,1:FOR N = 1 TO 80:PRINT" ";:NEXT N:LOCATE 20,1:FOR N = 1 TO 80:PRINT" ";:NEXT N:GOTO 8790
  265. 8820 LOCATE 20,1:INPUT"What should the score be";S(M,I)
  266. 8830 GOTO 7600
  267. 8840                REM********************************CHANGE MONEY ENTRY
  268. 8850 CLS:FOR M = 1 TO PLYRS:PRINT"Player";M;"(";TN$(PLYR(M));")";": ";MONEY(M):NEXT M
  269. 8860 PRINT:INPUT"What is the number of the player whose earnings are to be changed";NUM
  270. 8870 IF NUM<1 OR NUM>PLYRS THEN PRINT"Wrong number.....please try again.":GOTO 8860
  271. 8880 INPUT "Please enter the proper amount: ",MONEY(NUM):GOTO 7600
  272. 8900 RETURN
  273. 8910 CLOSE:OPEN "roundptr.dat" FOR INPUT AS #1:INPUT #1,ROUNDS:CLOSE #1
  274. 8940 OPEN "round.dat" AS #3 LEN = 59
  275. 8950 FIELD #3,8 AS D$,5 AS N$,5 AS C$,5 AS M$,2 AS S$(0),2 AS S$(1),2 AS S$(2),2 AS S$(3),2 AS S$(4),2 AS S$(5),2 AS S$(6),2 AS S$(7),2 AS S$(8),2 AS S$(9),2 AS S$(10),2 AS S$(11),2 AS S$(12),2 AS S$(13),2 AS S$(14),2 AS S$(15),2 AS S$(16),2 AS S$(17)
  276. 8960 FOR I = 1 TO PLYRS:ROUNDS = ROUNDS + 1:LSET N$=MKI$(PLYR(I)):LSET C$=MKI$(CORS):LSET M$=MKI$(MONEY(I)):LSET D$=DT$:FOR H=1 TO 18:LSET S$(H-1)=MKI$(S(I,H)):NEXT H:PUT #3,ROUNDS:NEXT I:OPEN "roundptr.dat" FOR OUTPUT AS #1:PRINT #1,ROUNDS
  277. 9110 GOTO 1000
  278. 9120 CLOSE:RETURN
  279. 10000 REM****************************************MODIFY PLAYER NAME
  280. 10010 CLS:GOSUB 22000:IF K= 0 THEN LOCATE 25,1:GOTO 27000
  281. 10020 IF (K+1)/2 = Y THEN PRINT
  282. 10025 PRINT
  283. 10030 PRINT:INPUT"Please type the number of the player whose name you wish to change: ",X
  284. 10040 IF X <1 OR X>K THEN PRINT"Wrong number.....please try again.":GOTO 10030
  285. 10050 CLS:PRINT"The name currently reads: ";TN$(X)
  286. 10060 LOCATE 3,23:PRINT"_______________":LOCATE 3,1
  287. 10070 INPUT "The name should read: ",NN$
  288. 10080 IF LEN (NN$)>15 THEN LOCATE 15,1:PRINT"Sorry, that name is too long.  Please shorten the":PRINT"name to fit on the dashed line (15 characters).":FOR P=1 TO 30:FOR T=1 TO 3000:NEXT T:NEXT P:GOTO 10050
  289. 10090 TN$(X)=NN$:CLOSE:KILL"golfers.dat":OPEN"golfers.dat" FOR OUTPUT AS #4:FOR I=1 TO K:PRINT #4,TN$(I):NEXT I:GOTO 1000
  290. 11000 REM****************************************MODIFY COURSE NAME
  291. 11010 CLS:GOSUB 23000:IF L = 0 THEN PRINT"Sorry, there are no courses listed in our files.":LOCATE 25,1:GOTO 27000
  292. 11020 PRINT:PRINT:INPUT"Please type the number of the course whose name you would like to change: ",C
  293. 11030 IF C<1 OR C>L THEN PRINT"Wrong number .....please try again.":GOTO 11020
  294. 11040 CLS:GET #2,C
  295. 11050 PRINT"The course name currently reads: ";COURSE$
  296. 11060 LOCATE 2,30:FOR I=1 TO 26:PRINT"_";:NEXT I:LOCATE 2,1
  297. 11070 INPUT "The course name should read: ",NC$
  298. 11080 IF LEN(NC$)>26 THEN 11120
  299. 11090 LSET COURSE$=NC$:PUT #2,C:GOTO 11170
  300. 11120 PRINT:PRINT"Sorry, that name is too long.  Please shorten":PRINT"the name to fit on the dashed line (26 characters).":FOR P=1 TO 30:FOR T= 1 TO 3000:NEXT T:NEXT P
  301. 11130 LOCATE 2,30:FOR I = 1 TO LEN(NC$):PRINT" ";:NEXT I
  302. 11140 FOR I=1 TO 2:LOCATE 3+I,1:PRINT"                                                                           ":NEXT I
  303. 11160 GOTO 11060
  304. 11170 GOTO 1000
  305. 12000 REM****************************************MODIFY COURSE PARS
  306. 12010 CLS:GOSUB 23000:IF L = 0 THEN PRINT"Sorry, there are no courses listed in our files":LOCATE 25,1:GOTO 27000
  307. 12020 PRINT:PRINT:PRINT"Please type the number of the course you would like to correct. ";
  308. 12025 INPUT"",C
  309. 12030 IF C<1 OR C>L THEN PRINT"Wrong number.....try again.":GOTO 12025
  310. 12040 GET #2,C:CORS$ = COURSE$:CLS:FOR I = 1 TO 18:P(I)=CVI(P$(I)):NEXT I:GOSUB 24000
  311. 12080 LOCATE 16,1
  312. 12090 PRINT:INPUT "Which hole is incorrect";H
  313. 12100 IF H<1 OR H>18 THEN PRINT"Please type a number from 1 to 18":GOTO 12080
  314. 12110 PRINT"Old par =";P(H)
  315. 12120 INPUT "New par = ",P(H)
  316. 12130 FOR I = 1 TO 18:LSET P$(I)=MKI$(P(I)):NEXT I:PUT #2,C:GOTO 1000
  317. 13000 REM****************************************MODIFY GAME
  318. 13005 ZZZ = 999:GOSUB 13010:IF L=O THEN LOCATE 25,1:GOTO 27000
  319. 13007 GOTO 13330
  320. 13010 CLS:PRINT"Please enter the date of the game which needs to be modified":INPUT"using the form mm/dd/yy. ",DT$
  321. 13020 GOSUB 25030
  322. 13030 OPEN "golfptr.dat" FOR INPUT AS #1:INPUT #1,K:CLOSE #1:OPEN "golfers.dat" FOR INPUT AS #4:FOR I = 1 TO K:LINE INPUT #4,TN$(I):NEXT I
  323. 13100 CLS:GOSUB 23000:IF L = 0 THEN PRINT"Sorry, there are no games (or even any courses) listed in our files.":RETURN
  324. 13110 PRINT:PRINT:INPUT"Please type the number of the course at which the game was played: ",C
  325. 13120 IF C<1 OR C>L THEN PRINT"Wrong number.....please try again.":GOTO 13110
  326. 13125 CLS:LOCATE 10,30:PRINT"One moment please....."
  327. 13130 FRONTP=O:BACKP=0:TOTP=0:GET #2,C
  328. 13140 FOR H = 1 TO 9:FRONTP = FRONTP + CVI(P$(H)):NEXT H
  329. 13150 FOR H = 10 TO 18:BACKP = BACKP + CVI(P$(H)):NEXT H:TOTP=FRONTP+BACKP:OPEN "ROUNDPTR.DAT" FOR INPUT AS #1:INPUT #1,ROUNDS:CLOSE #1:OPEN "ROUND.DAT" AS #3 LEN = 59
  330. 13210 FIELD #3,8 AS D$,5 AS N$,5 AS C$,5 AS M$,2 AS S$(0),2 AS S$(1),2 AS S$(2),2 AS S$(3),2 AS S$(4),2 AS S$(5),2 AS S$(6),2 AS S$(7),2 AS S$(8),2 AS S$(9),2 AS S$(10),2 AS S$(11),2 AS S$(12),2 AS S$(13),2 AS S$(14),2 AS S$(15),2 AS S$(16),2 AS S$(17)
  331. 13220 G=0:FOR I = 1 TO ROUNDS:GET #3,I:IF D$<>DT$ OR CVI(C$)<>C THEN 13310
  332. 13270 G=G+1:R(G) = I:PLYR(G) = CVI(N$):MONEY(G)=CVI(M$):CORS=CVI(C$):FOR H=0 TO 17:S(G,H+1)=CVI(S$(H)):NEXT H:MONEY(G)=CVI(M$)
  333. 13310 NEXT I
  334. 13320 IF G = 0 THEN CLS:PRINT"Sorry, there are no entries for ";DT$;" at ";COURSE$:LOCATE 25,1:GOTO 27000
  335. 13325 RETURN
  336. 13330 PLYRS = G:GOSUB 7600
  337. 13340 FOR I = 1 TO G:LSET D$=DT$:LSET M$=MKI$(MONEY(I)):LSET N$=MKI$(PLYR(I)):LSET C$=MKI$(CORS):FOR H= 0 TO 17:LSET S$(H)=MKI$(S(I,H+1)):NEXT H:PUT #3,R(I):NEXT I
  338. 13440 GOTO 1000
  339. 14000 REM****************************************DISPLAY LIST OF PLAYERS
  340. 14010 CLS:GOSUB 22000
  341. 14015 IF (K+1)/2 = Y THEN PRINT
  342. 14020 LOCATE 25,1:GOTO 27000
  343. 15000 REM****************************************DISPLAY PLAYER AVERAGES
  344. 15005 CLS:LOCATE 10,30:PRINT"One moment please.....":GOSUB 15010:GOTO 15286
  345. 15010 OPEN "roundptr.dat" FOR INPUT AS #1:INPUT #1,ROUNDS:CLOSE #1:OPEN "ROUND.DAT" AS #3 LEN=59
  346. 15050 FIELD #3,8 AS D$,5 AS N$,5 AS C$,5 AS M$,2 AS S$(0),2 AS S$(1),2 AS S$(2),2 AS S$(3),2 AS S$(4),2 AS S$(5),2 AS S$(6),2 AS S$(7),2 AS S$(8),2 AS S$(9),2 AS S$(10),2 AS S$(11),2 AS S$(12),2 AS S$(13),2 AS S$(14),2 AS S$(15),2 AS S$(16),2 AS S$(17)
  347. 15060 OPEN "golfptr.dat" FOR INPUT AS #1:INPUT #1,K
  348. 15080 CLOSE #1:IF K=0 THEN CLS:PRINT"Sorry, there are no registered golfers.":LOCATE 25,1:GOTO 27000
  349. 15090 OPEN "golfers.dat" FOR INPUT AS #4:FOR I=1 TO K:LINE INPUT #4,TN$(I)
  350. 15120 NEXT I:FOR PL=1 TO K:GAMTOT(PL)=0:SCORTOT(PL)=0:NEXT PL
  351. 15165 GOSUB 27500
  352. 15170 FOR GAM=1 TO ROUNDS:GET #3,GAM
  353. 15185 GET #2,CVI(C$):IF INSTR(COURSE$,CC$)<>0 THEN 15280
  354. 15190 PL=CVI(N$)
  355. 15220 GAMTOT(PL)=GAMTOT(PL)+1
  356. 15230 FOR X=0 TO 17
  357. 15240 SCORTOT(PL)=SCORTOT(PL)+CVI(S$(X))
  358. 15270 NEXT X
  359. 15280 NEXT GAM
  360. 15285 RETURN
  361. 15286 C=0:P=0
  362. 15287 IF K-C<22 THEN I=K-C ELSE I=21
  363. 15290 CLS:LOCATE 1,1:PRINT"PLAYER":LOCATE 1,40:PRINT"GAMES PLAYED":LOCATE 1,67:PRINT"AVERAGE"
  364. 15320 FOR PL=P+1 TO P+I:IF GAMTOT(PL)=0 THEN AVG!(PL) = 0:GOTO 15350
  365. 15340 AVG!(PL)=SCORTOT(PL)/GAMTOT(PL)
  366. 15350 LOCATE 2+PL-P,1:PRINT TN$(PL)
  367. 15360 LOCATE 2+PL-P,45
  368. 15362 IF GAMTOT(PL)<10 THEN 15368
  369. 15364 PRINT CHR$(29);:IF GAMTOT(PL)<100 THEN 15368
  370. 15366 PRINT CHR$(29);:IF GAMTOT(PL)<1000 THEN 15368
  371. 15367 PRINT CHR$(29);
  372. 15368 PRINT GAMTOT(PL)
  373. 15370 LOCATE 2+PL-P,67:PRINT USING "###.##";AVG!(PL)
  374. 15380 C=C+1:NEXT PL
  375. 15390 LOCATE 25,1:IF C=K THEN 27000
  376. 15400 PRINT"Press any key to continue...";
  377. 15410 A$=INKEY$
  378. 15420 IF A$="" THEN 15410
  379. 15430 P=P+21:GOTO 15287
  380. 16000 REM****************************************DISPLAY WINNINGS/LOSSES
  381. 16005 CLS:LOCATE 10,30:PRINT"One moment please.....":GOSUB 16010:GOTO 16240
  382. 16010 OPEN "roundptr.dat" FOR INPUT AS #1:INPUT #1,ROUNDS:CLOSE #1:OPEN"ROUND.DAT" AS #3 LEN=59
  383. 16050 FIELD #3,8 AS D$,5 AS N$,5 AS C$,5 AS M$,2 AS S$(0),2 AS S$(1),2 AS S$(2),2 AS S$(3),2 AS S$(4),2 AS S$(5),2 AS S$(6),2 AS S$(7),2 AS S$(8),2 AS S$(9),2 AS S$(10),2 AS S$(11),2 AS S$(12),2 AS S$(13),2 AS S$(14),2 AS S$(15),2 AS S$(16),2 AS S$(17)
  384. 16060 OPEN "golfptr.dat" FOR INPUT AS #1:INPUT #1,K
  385. 16080 CLOSE #1:IF K = 0 THEN CLS:PRINT"Sorry, there are no registered golfers.":LOCATE 25,1:GOTO 27000
  386. 16090 OPEN "GOLFERS.DAT" FOR INPUT AS #4:FOR I=1 TO K:LINE INPUT #4,TN$(I):NEXT I:FOR PL=1 TO K:MONTOT(PL)=0:GAMTOT(PL)=0:NEXT PL:FOR GAM=1 TO ROUNDS:GET #3,GAM:PL=CVI(N$)
  387. 16210 MONTOT(PL) = MONTOT(PL)+CVI(M$):GAMTOT(PL)=GAMTOT(PL)+1:NEXT GAM
  388. 16230 RETURN
  389. 16240 C=0:P=0
  390. 16241 IF K-C<22 THEN I=K-C ELSE I=21
  391. 16242 CLS:LOCATE 1,1:PRINT"PLAYER":LOCATE 1,40:PRINT"GAMES PLAYED":LOCATE 1,60:PRINT"WINNINGS/LOSSES":FOR PL=P+1 TO P+I:LOCATE 2+PL-P,1:PRINT TN$(PL):LOCATE 2+PL-P,45
  392. 16292 IF GAMTOT(PL)<10 THEN 16298
  393. 16294 PRINT CHR$(29);:IF GAMTOT(PL)<100 THEN 16298
  394. 16296 PRINT CHR$(29);:IF GAMTOT(PL)<1000 THEN 16298
  395. 16297 PRINT CHR$(29);
  396. 16298 PRINT GAMTOT(PL)
  397. 16300 IF MONTOT(PL)>999 OR MONTOT(PL)<-999 THEN LOCATE 2+PL-P,65:PRINT MONTOT(PL):GOTO 16340
  398. 16310 IF MONTOT(PL)>99 OR MONTOT(PL)<-99 THEN LOCATE 2+PL-P,66:PRINT MONTOT(PL):GOTO 16340
  399. 16320 IF MONTOT(PL)>9 OR MONTOT(PL)<-9 THEN LOCATE 2+PL-P,67:PRINT MONTOT(PL):GOTO 16340
  400. 16330 LOCATE 2+PL-P,68:PRINT MONTOT(PL)
  401. 16340 C=C+1:NEXT PL
  402. 16350 LOCATE 25,1:IF C=K THEN 27000
  403. 16360 PRINT"Press any key to continue...";
  404. 16370 A$=INKEY$
  405. 16380 IF A$="" THEN 16370
  406. 16390 P=P+21:GOTO 16241
  407. 17000 REM***************DISPLAY INDIVIDUAL PLAYER'S AVERAGE FOR SPECIFIC COURSE
  408. 17005 GOSUB 17010:GOTO 17390
  409. 17010 CLS:GOSUB 22000:PRINT:PRINT:IF K = 0 THEN LOCATE 25,1:GOTO 27000
  410. 17020 PRINT:PRINT:INPUT"Please enter the number of the player you would like to know about?  ",X
  411. 17030 IF X<1 OR X>K THEN PRINT"Wrong number.....please try again.":GOTO 17020
  412. 17040 CLS:GOSUB 23000:IF L=0 THEN PRINT"Sorry, there are no courses listed in our files.":LOCATE 25,1:GOTO 27000
  413. 17050 PRINT
  414. 17060 PRINT:INPUT"Please enter the number of the course you would like to know about?  ",Y
  415. 17070 IF Y<1 OR Y>L THEN PRINT"Wrong number.....please try again.":GOTO 17060
  416. 17075 CLS:LOCATE 10,30:PRINT"One moment please....."
  417. 17080 GET #2,Y
  418. 17081 FRONT = 0:BACK = 0:FOR H = 1 TO 9:FRONT = FRONT +CVI(P$(H)):BACK = BACK + CVI(P$(H+9)):NEXT H
  419. 17090 OPEN "roundptr.dat" FOR INPUT AS #1:INPUT #1,ROUNDS:CLOSE #1:OPEN "ROUND.DAT" AS #3 LEN=59
  420. 17130 FIELD #3,8 AS D$,5 AS N$,5 AS C$,5 AS M$,2 AS S$(0),2 AS S$(1),2 AS S$(2),2 AS S$(3),2 AS S$(4),2 AS S$(5),2 AS S$(6),2 AS S$(7),2 AS S$(8),2 AS S$(9),2 AS S$(10),2 AS S$(11),2 AS S$(12),2 AS S$(13),2 AS S$(14),2 AS S$(15),2 AS S$(16),2 AS S$(17)
  421. 17140 GAMTOT=0:FRONTT=0:BACKT=0:FOR H=1 TO 18:T(H)=0:NEXT H:FOR GAM=1 TO ROUNDS:GET #3,GAM
  422. 17200 IF X <> CVI(N$) OR Y <> CVI(C$) THEN 17260
  423. 17210 GAMTOT = GAMTOT+1:FOR H=1 TO 18:T(H)=T(H)+CVI(S$(H-1)):NEXT H
  424. 17260 NEXT GAM
  425. 17270 FOR H=1 TO 9:FRONTT = FRONTT +T(H):BACKT = BACKT+T(H+9):NEXT H
  426. 17340 IF GAMTOT=0 THEN CLS:PRINT"Sorry, ";TN$(X);" has no recorded rounds at ";COURSE$;:LOCATE 25,1:GOTO 27000
  427. 17350 FAVG!=FRONTT/GAMTOT:BAVG!=BACKT/GAMTOT:TOTAVG!=(FRONTT+BACKT)/GAMTOT:FOR H=1 TO 18:AVG!(H)=T(H)/GAMTOT:NEXT H
  428. 17385 RETURN
  429. 17390 CLS
  430. 17400 LOCATE 1,40:PRINT"Player:  ";TN$(X):LOCATE 2,40:PRINT"Course:  ";COURSE$:LOCATE 3,40:PRINT"Games Played: ";GAMTOT:LOCATE 4,1:PRINT:FOR H=1 TO 18:IF H<10 THEN PRINT " ";
  431. 17440 PRINT H;"     ";:PRINT USING"###.##";AVG!(H);:PRINT"      ";CVI(P$(H)):NEXT H
  432. 17450 LOCATE 3,1:PRINT"Hole":LOCATE 3,11:PRINT"Average":LOCATE 3,21:PRINT"Par"
  433. 17460 LOCATE 10,50:PRINT"Average       Par"
  434. 17470 LOCATE 12,40:PRINT"Front      ";:PRINT USING"###.##";FAVG!;:PRINT"       ";FRONT
  435. 17480 LOCATE 13,40:PRINT"Back       ";:PRINT USING"###.##";BAVG!;:PRINT"       ";BACK
  436. 17490 LOCATE 14,40:PRINT"Total      ";:PRINT USING "###.##";TOTAVG!;:PRINT"       ";FRONT +BACK
  437. 17500 LOCATE 22,32
  438. 17510 GOTO 27000
  439. 18000 REM**********************DISPLAY INDIVIDUAL PLAYER'S HOLE AVERAGES BY PAR
  440. 18005 GOSUB 18010:IF K=0 THEN LOCATE 25,1:GOTO 27000
  441. 18007 GOTO 18330
  442. 18010 CLS:GOSUB 22000:IF K=O THEN RETURN
  443. 18020 PRINT:PRINT
  444. 18030 PRINT:INPUT"Please enter the number of the player you would like to know about?  ",X
  445. 18040 IF X<1 OR X>K THEN PRINT"Wrong number.....please try again.":GOTO 18030
  446. 18045 CLS:LOCATE 10,30:PRINT"One moment please....."
  447. 18050 OPEN "COURSE.DAT" AS #2 LEN = 62
  448. 18060 FIELD #2,26 AS COURSE$,2 AS P$(1),2 AS P$(2),2 AS P$(3),2 AS P$(4),2 AS P$(5),2 AS P$(6),2 AS P$(7),2 AS P$(8),2 AS P$(9),2 AS P$(10),2 AS P$(11),2 AS P$(12),2 AS P$(13),2 AS P$(14),2 AS P$(15),2 AS P$(16),2 AS P$(17),2 AS P$(18)
  449. 18070 OPEN "roundptr.dat" FOR INPUT AS #1:INPUT #1,ROUNDS:CLOSE #1:OPEN "round.dat" AS #3 LEN=59
  450. 18110 FIELD #3,8 AS D$,5 AS N$,5 AS C$,5 AS M$,2 AS S$(0),2 AS S$(1),2 AS S$(2),2 AS S$(3),2 AS S$(4),2 AS S$(5),2 AS S$(6),2 AS S$(7),2 AS S$(8),2 AS S$(9),2 AS S$(10),2 AS S$(11),2 AS S$(12),2 AS S$(13),2 AS S$(14),2 AS S$(15),2 AS S$(16),2 AS S$(17)
  451. 18120 GMTOT=0:P3STOT=0:P3HTOT=0:P4STOT=0:P4HTOT=0:P5STOT=0:P5HTOT=0:FOR I=1 TO ROUNDS:GET #3,I
  452. 18180 GET #2,CVI(C$):IF INSTR(COURSE$,CC$)<>0 OR X<>CVI(N$) THEN 18260
  453. 18200 GMTOT = GMTOT +1
  454. 18210 FOR H = 1 TO 18
  455. 18220 IF CVI(P$(H)) = 3 THEN P3STOT = P3STOT+CVI(S$(H-1)):P3HTOT = P3HTOT+1:GOTO 18250
  456. 18230 IF CVI(P$(H)) = 4 THEN P4STOT = P4STOT+CVI(S$(H-1)):P4HTOT = P4HTOT+1:GOTO 18250
  457. 18240 P5STOT = P5STOT+CVI(S$(H-1)):P5HTOT = P5HTOT+1
  458. 18250 NEXT H
  459. 18260 NEXT I
  460. 18270 IF P3HTOT <> 0 THEN P3AVG! = P3STOT/P3HTOT:GOTO 18290
  461. 18280 P3AVG! = 0
  462. 18290 IF P4HTOT <> 0 THEN P4AVG! = P4STOT/P4HTOT:GOTO 18310
  463. 18300 P4AVG! = 0
  464. 18310 IF P5HTOT <> 0 THEN P5AVG! = P5STOT/P5HTOT:GOTO 18325
  465. 18320 P5AVG! = 0
  466. 18325 RETURN
  467. 18330 IF GMTOT=0 THEN CLS:PRINT"Sorry, ";TN$(X);" has no recorded rounds.":LOCATE 25,1:GOTO 27000
  468. 18335 CLS:PRINT"Player:  ";TN$(X)
  469. 18340 PRINT"Games played:  "GMTOT
  470. 18350 PRINT:PRINT"Par 3 holes played: ";P3HTOT;:LOCATE 4,40:PRINT USING "PAR 3 AVERAGE:###.##";P3AVG!
  471. 18360 PRINT:PRINT"Par 4 holes played: ";P4HTOT;:LOCATE 6,40:PRINT USING "PAR 4 AVERAGE:###.##";P4AVG!
  472. 18370 PRINT:PRINT"Par 5 holes played: ";P5HTOT;:LOCATE 8,40:PRINT USING "PAR 5 AVERAGE:###.##";P5AVG!
  473. 18380 PRINT:PRINT:GOTO 27000
  474. 19000 REM************************************DISPLAY INDIVIDUAL PLAYER'S ROUNDS
  475. 19005 GOSUB 19010:IF K=0 THEN LOCATE 25,1:GOTO 27000
  476. 19006 GOTO 19137
  477. 19010 CLS:GOSUB 22000
  478. 19012 IF K=O THEN RETURN
  479. 19015 PRINT:IF Y = (K+1)/2 THEN PRINT
  480. 19020 PRINT:INPUT"Please type the number of the player you would like to know about: ",PR
  481. 19030 IF PR<1 OR PR>K THEN PRINT"Wrong number.....please try again.":GOTO 19020
  482. 19035 CLS:LOCATE 10,30:PRINT"One moment please....."
  483. 19050 OPEN "roundptr.dat" FOR INPUT AS #1:INPUT #1,ROUNDS:CLOSE #1:OPEN "round.dat" AS #3 LEN=59
  484. 19090 FIELD #3,8 AS D$,5 AS N$,5 AS C$,5 AS M$,2 AS S$(0),2 AS S$(1),2 AS S$(2),2 AS S$(3),2 AS S$(4),2 AS S$(5),2 AS S$(6),2 AS S$(7),2 AS S$(8),2 AS S$(9),2 AS S$(10),2 AS S$(11),2 AS S$(12),2 AS S$(13),2 AS S$(14),2 AS S$(15),2 AS S$(16),2 AS S$(17)
  485. 19100 OPEN "COURSPTR.DAT" FOR INPUT AS #1:INPUT #1,L:OPEN "course.dat" AS #2 LEN=62
  486. 19130 FIELD #2,26 AS COURSE$,2 AS P$(1),2 AS P$(2),2 AS P$(3),2 AS P$(4),2 AS P$(5),2 AS P$(6),2 AS P$(7),2 AS P$(8),2 AS P$(9),2 AS P$(10),2 AS P$(11),2 AS P$(12),2 AS P$(13),2 AS P$(14),2 AS P$(15),2 AS P$(16),2 AS P$(17),2 AS P$(18)
  487. 19135 RETURN
  488. 19137 C=0:P=0
  489. 19140 R=0:FOR I=1 TO ROUNDS:GET #3,I
  490. 19145 IF PR<>CVI(N$) THEN 19205
  491. 19150 IF R=0 THEN CLS:PRINT TN$(PR):PRINT:PRINT"DATE         COURSE                        MONEY          FRONT    BACK   TOTAL":PRINT
  492. 19155 GET #2,CVI(C$):PRINT D$;SPC(5);COURSE$;SPC(2);
  493. 19160 IF CVI(M$)<-999 OR CVI(M$)>999 THEN PRINT SPC(2);CVI(M$);:GOTO 19180
  494. 19165 IF CVI(M$)<-99 OR CVI(M$)>99 THEN PRINT SPC(3);CVI(M$);:GOTO 19180
  495. 19170 IF CVI(M$)<-9 OR CVI(M$)>9 THEN PRINT SPC(4);CVI(M$);:GOTO 19180
  496. 19175 PRINT SPC(5);CVI(M$);
  497. 19180 FRONT = 0:BACK = 0:FOR H = 0 TO 8:FRONT = FRONT + CVI(S$(H)):NEXT H:FOR H = 9 TO 17:BACK = BACK + CVI(S$(H)):NEXT H
  498. 19185 PRINT SPC(10)FRONT;SPC(4);BACK;
  499. 19190 IF FRONT + BACK >99 THEN PRINT SPC(3);FRONT+BACK:GOTO 19200
  500. 19195 PRINT SPC(4)FRONT+BACK
  501. 19200 R=1
  502. 19202 C=C+1:IF C-P=19 THEN LOCATE 25,1 ELSE 19205
  503. 19203 P=C:R=0:PRINT"Press any key to continue...";
  504. 19204 A$=INKEY$:IF A$="" THEN 19204
  505. 19205 NEXT I
  506. 19210 IF R = O THEN CLS:PRINT"Sorry, ";TN$(PR);" has no recorded rounds."
  507. 19215 LOCATE 25,1:GOTO 27000
  508. 20000 REM****************************************DISPLAY COURSE DATA
  509. 20010 CLS:GOSUB 23000:IF L=0 THEN PRINT"Sorry, there are no courses listed in our files.":LOCATE 25,1:GOTO 27000
  510. 20020 PRINT:PRINT:PRINT "Would you like detailed information about a course?":PRINT"Please type `Y' or `N': ";
  511. 20030 INPUT"",A$
  512. 20040 IF A$ = "Y" OR A$ = "y" THEN 20070
  513. 20050 IF A$ = "n" OR A$ = "N" THEN 1000
  514. 20060 BEEP:PRINT"Please type `Y' or `N'. ";:GOTO 20030
  515. 20070 PRINT:INPUT"Please enter the number of the course you would like to know about. ",COURSE
  516. 20080 IF COURSE <1 OR COURSE >L THEN PRINT"Wrong number.....please try again.":GOTO 20070
  517. 20090 GET #2,COURSE:CORS$=COURSE$:FOR I=1 TO 18:P(I)=CVI(P$(I)):NEXT I
  518. 20140 CLOSE:CLS:GOSUB 24000
  519. 20150 LOCATE 19,1
  520. 20160 GOTO 27000
  521. 21000 REM****************************************ERASE PROCEDURE
  522. 21010 FOR X=1 TO 8:LOCATE X+14,1:FOR Y = 1 TO 80:PRINT" ";:NEXT Y:NEXT X
  523. 21020 LOCATE 21,1:FOR I = 1 TO 60:PRINT" ";:NEXT I
  524. 21030 LOCATE 23,1:FOR I = 1 TO 40:PRINT" ";:NEXT I
  525. 21040 RETURN
  526. 22000 REM****************************************LIST OF GOLFERS
  527. 22005 GOSUB 22010:GOTO 22080
  528. 22010 OPEN "golfptr.dat" FOR INPUT AS #1:INPUT #1,K
  529. 22030 CLOSE #1:IF K=0 THEN CLS:PRINT"Sorry, there are no registered golfers.":RETURN
  530. 22040 OPEN "golfers.dat" FOR INPUT AS #4:FOR I=1 TO K:LINE INPUT #4,TN$(I):NEXT I:RETURN
  531. 22080 IF K=0 THEN RETURN
  532. 22085 Y=K/2:CLS:LOCATE 1,1
  533. 22090 FOR I=1 TO Y:LOCATE I,1
  534. 22110 IF I>9 THEN PRINT I;CHR$(29);".  ";TN$(I);:GOTO 22130
  535. 22120 PRINT " ";I;CHR$(29);".  ";TN$(I);
  536. 22130 NEXT I
  537. 22140 FOR I=(Y+1) TO K
  538. 22150 LOCATE (I-Y),40
  539. 22160 IF I>9 THEN PRINT I;CHR$(29);".  ";TN$(I);:GOTO 22180
  540. 22170 PRINT " ";I;CHR$(29);".  ";TN$(I);
  541. 22180 NEXT I
  542. 22190 RETURN
  543. 23000 REM****************************************LIST OF COURSES
  544. 23010 OPEN "COURSPTR.DAT" FOR INPUT AS #1:INPUT #1,L
  545. 23030 CLOSE #1:IF L=0 THEN RETURN
  546. 23040 OPEN "COURSE.DAT" AS #2 LEN=62
  547. 23050 FIELD #2,26 AS COURSE$,2 AS P$(1),2 AS P$(2),2 AS P$(3),2 AS P$(4),2 AS P$(5),2 AS P$(6),2 AS P$(7),2 AS P$(8),2 AS P$(9),2 AS P$(10),2 AS P$(11),2 AS P$(12),2 AS P$(13),2 AS P$(14),2 AS P$(15),2 AS P$(16),2 AS P$(17),2 AS P$(18)
  548. 23056 P=0
  549. 23058 IF L-P>19 THEN D=19 ELSE D=L-P
  550. 23060 LOCATE 1,1:PRINT"COURSE":LOCATE 1,38:PRINT"FRONT PAR":LOCATE 1,52:PRINT "BACK PAR":LOCATE 1,70:PRINT "TOTAL PAR":FOR I=1 TO D:GET #2,I+P:LOCATE 2+I,1
  551. 23130 IF I+P>9 THEN PRINT I+P;CHR$(29);".  ";:GOTO 23140
  552. 23132 PRINT" ";I+P;CHR$(29);".  ";
  553. 23140 PRINT COURSE$:FRONT=0:BACK=0:FOR J=1 TO 9:FRONT=FRONT+CVI(P$(J)):BACK=BACK+CVI(P$(J+9)):NEXT J:LOCATE 2+I,44:PRINT FRONT:LOCATE 2+I,57:PRINT BACK:LOCATE 2+I,76:PRINT FRONT+BACK;:NEXT I
  554. 23270 IF I+P>L THEN 23280
  555. 23272 P=P+19:LOCATE 25,1:PRINT"Press any key to continue...";
  556. 23274 A$=INKEY$:IF A$="" THEN 23274
  557. 23276 CLS:GOTO 23058
  558. 23280 RETURN
  559. 24000 REM****************************************INDIVIDUAL COURSE DATA
  560. 24010 FP=0:BP=0:LOCATE 1,15:PRINT"Course Name:":LOCATE 1,28:PRINT CORS$:LOCATE 3,15:PRINT"HOLE":LOCATE 3,25:PRINT"PAR":LOCATE 3,55:PRINT"HOLE":LOCATE 3,65:PRINT"PAR":FOR I=1 TO 9:LOCATE I+4,16:PRINT I:LOCATE I+4,25:PRINT P(I)
  561. 24170 FP=FP+P(I):NEXT I:LOCATE 15,16:PRINT"FRONT":LOCATE 15,24:PRINT FP:FOR I=10 TO 18:LOCATE I-5,56:PRINT I:LOCATE I-5,65:PRINT P(I):BP=BP+P(I):NEXT I:LOCATE 15,56:PRINT"BACK":LOCATE 15,64:PRINT BP:LOCATE 1,64:PRINT"COURSE PAR:";FP+BP:RETURN
  562. 25000 REM****************************************DATE INPUT
  563. 25020 INPUT"Please type the date in the form mm/dd/yy: ",DT$
  564. 25025 IF LEN(DT$)<>8 THEN 25190
  565. 25030 FOR I = 0 TO 2:FOR N = 1 TO 2
  566. 25040 IF MID$(DT$,N+3*I,1)="0" THEN 25150
  567. 25050 IF MID$(DT$,N+3*I,1)="1" THEN 25150
  568. 25060 IF MID$(DT$,N+3*I,1)="2" THEN 25150
  569. 25070 IF MID$(DT$,N+3*I,1)="3" THEN 25150
  570. 25080 IF MID$(DT$,N+3*I,1)="4" THEN 25150
  571. 25090 IF MID$(DT$,N+3*I,1)="5" THEN 25150
  572. 25100 IF MID$(DT$,N+3*I,1)="6" THEN 25150
  573. 25110 IF MID$(DT$,N+3*I,1)="7" THEN 25150
  574. 25120 IF MID$(DT$,N+3*I,1)="8" THEN 25150
  575. 25130 IF MID$(DT$,N+3*I,1)="9" THEN 25150
  576. 25140 GOTO 25190
  577. 25150 NEXT N
  578. 25160 NEXT I
  579. 25170 IF MID$(DT$,3,1)<>"/" THEN 25190
  580. 25180 IF MID$(DT$,6,1)="/" THEN 25200
  581. 25190 PRINT"That entry is invalid.  Please check the form and try again.":PRINT:GOTO 25020
  582. 25200 RETURN
  583. 26000 REM****************************************LOGO
  584. 26010 CLS:LOCATE 1,31:PRINT CHR$(201);:FOR I=1 TO 18:PRINT CHR$(205);:NEXT I:PRINT CHR$(187):LOCATE 2,31:PRINT CHR$(186):LOCATE 3,31:PRINT CHR$(186):LOCATE 4,31:PRINT CHR$(200);:FOR I=1 TO 18:PRINT CHR$(205);:NEXT I
  585. 26160 PRINT CHR$(188):LOCATE 2,50:PRINT CHR$(186):LOCATE 3,50:PRINT CHR$(186):LOCATE 2,35:PRINT"THE PERSONAL":LOCATE 3,37:PRINT"GOLFCARD":RETURN
  586. 27000 REM****************************************RETURN TO MAIN MENU
  587. 27010 PRINT"Press any key to return to Main Menu. ";
  588. 27020 A$=INKEY$
  589. 27030 IF A$="" THEN 27020 ELSE GOTO 1000
  590. 27500 REM****************************************OPEN COURSE FILE
  591. 27510 OPEN "COURSPTR.DAT" FOR INPUT AS #1:INPUT #1,L:CLOSE #1:OPEN "COURSE.DAT" AS #2 LEN=62
  592. 27540 FIELD #2,26 AS COURSE$,2 AS P$(1),2 AS P$(2),2 AS P$(3),2 AS P$(4),2 AS P$(5),2 AS P$(6),2 AS P$(7),2 AS P$(8),2 AS P$(9),2 AS P$(10),2 AS P$(11),2 AS P$(12),2 AS P$(13),2 AS P$(14),2 AS P$(15),2 AS P$(16),2 AS P$(17),2 AS P$(18)
  593. 27545 RETURN
  594. 28000 CLOSE:REM****************************************PRINT MENU
  595. 28010 GOSUB 26000:LOCATE 7,20:PRINT"HERE'S THE INFORMATION YOU CAN HAVE PRINTED":GOSUB 4030:GOTO 28200
  596. 28200 LOCATE 20,20
  597. 28210 INPUT"Please type the number of your choice. ",A
  598. 28220 ON A GOTO 28300,28400,28500,29400,28600,28700,28800,28900,29200,1000
  599. 28230 BEEP:GOTO 28200
  600. 28300 REM****************************************PRINT LIST OF GOLFERS
  601. 28310 CLS:LOCATE 10,30:PRINT"One moment please.....":GOSUB 22010:IF K=0 THEN LOCATE 25,1:GOTO 27000
  602. 28315 LPRINT"REGISTERED GOLFERS":LPRINT:FOR I=1 TO K:IF I<10 THEN LPRINT" ";
  603. 28320 LPRINT I;"  ";TN$(I):NEXT I:GOTO 1000
  604. 28400 REM*****************************************PRINT PLAYER AVERAGES
  605. 28405 CLS:LOCATE 10,30:PRINT"One moment please.....":GOSUB 15010
  606. 28410 LPRINT"PLAYER                                GAMES PLAYED               AVERAGE":LPRINT
  607. 28415 FOR PL = 1 TO K
  608. 28420 IF GAMTOT(PL)= 0 THEN AVG!(PL) = 0:GOTO 28445
  609. 28425 AVG!(PL)=SCORTOT(PL)/GAMTOT(PL)
  610. 28430 IF GAMTOT(PL)>999 THEN GAMDIG(PL)=4:GOTO 28450
  611. 28435 IF GAMTOT(PL)>99 THEN GAMDIG(PL) =3:GOTO 28450
  612. 28440 IF GAMTOT(PL)>9 THEN GAMDIG(PL) =2:GOTO 28450
  613. 28445 GAMDIG(PL) = 1
  614. 28450 XX = LEN(TN$(PL))+GAMDIG(PL)
  615. 28455 LPRINT TN$(PL);SPC(45-XX)GAMTOT(PL);SPC(19)
  616. 28460 LPRINT USING "###.##";AVG!(PL):NEXT PL
  617. 28465 GOTO 1000
  618. 28500 REM****************************************PRINT WINNINGS/LOSSES
  619. 28510 CLS:LOCATE 10,30:PRINT"One moment please.....":GOSUB 16010
  620. 28520 LPRINT"PLAYER                                GAMES PLAYED        WINNINGS/LOSSES":LPRINT
  621. 28530 FOR PL = 1 TO K
  622. 28531 IF GAMTOT(PL)>999 THEN GAMDIG(PL)=4:GOTO 28540
  623. 28532 IF GAMTOT(PL)>99 THEN GAMDIG(PL) =3:GOTO 28540
  624. 28533 IF GAMTOT(PL)>9 THEN GAMDIG(PL) =2:GOTO 28540
  625. 28534 GAMDIG(PL) = 1
  626. 28540 IF MONTOT(PL)<-9999 OR MONTOT(PL)>9999 THEN MONDIG(PL) = 5:GOTO 28580
  627. 28541 IF MONTOT(PL)<-999 OR MONTOT(PL)>999 THEN MONDIG(PL) = 4:GOTO 28580
  628. 28542 IF MONTOT(PL)<-99 OR MONTOT(PL)>99 THEN MONDIG(PL) = 3:GOTO 28580
  629. 28543 IF MONTOT(PL)<-9 OR MONTOT(PL)>9 THEN MONDIG(PL) = 2:GOTO 28580
  630. 28544 MONDIG(PL) = 1
  631. 28580 XX=LEN(TN$(PL))+GAMDIG(PL):LPRINT TN$(PL);SPC(45-XX)GAMTOT(PL);SPC(20-MONDIG(PL))MONTOT(PL):NEXT PL
  632. 28590 GOTO 1000
  633. 28600 REM*****************PRINT INDIVIDUAL PLAYER'S AVERAGE FOR SPECIFIC COURSE
  634. 28610 GOSUB 17010
  635. 28620 LPRINT"Player:  ";TN$(X):LPRINT"Course:  ";COURSE$:LPRINT"Games Played: ";GAMTOT
  636. 28645 LPRINT:LPRINT"Hole          Average          Par"
  637. 28650 LPRINT:FOR H = 1 TO 18:IF H<10 THEN LPRINT" ";
  638. 28660 LPRINT H;"          ";:LPRINT USING"###.##";AVG!(H);:LPRINT"           ";CVI(P$(H)):NEXT H
  639. 28670 LPRINT:LPRINT "Front";SPC(9);:LPRINT USING"###.##";FAVG!;:LPRINT SPC(10)FRONT
  640. 28675 LPRINT "Back ";SPC(9);:LPRINT USING"###.##";BAVG!;:LPRINT SPC(10)BACK
  641. 28680 LPRINT "Total";SPC(9);:LPRINT USING"###.##";TOTAVG!;:LPRINT SPC(10)BACK+FRONT
  642. 28690 GOTO 1000
  643. 28700 REM************************PRINT INDIVIDUAL PLAYER'S HOLE AVERAGES BY PAR
  644. 28710 GOSUB 18010:IF K=0 THEN LOCATE 25,1:GOTO 27000
  645. 28711 IF P3HTOT>999 THEN P3HTD = 4:GOTO 28715
  646. 28712 IF P3HTOT>99 THEN P3HTD = 3:GOTO 28715
  647. 28713 IF P3HTOT>9 THEN P3HTD = 2:GOTO 28715
  648. 28714 P3HTD = 1
  649. 28715 IF P4HTOT>999 THEN P4HTD = 4:GOTO 28719
  650. 28716 IF P4HTOT>99 THEN P4HTD = 3:GOTO 28719
  651. 28717 IF P4HTOT>9 THEN P4HTD = 2:GOTO 28719
  652. 28718 P4HTD = 1
  653. 28719 IF P5HTOT>999 THEN P5HTD = 4:GOTO 28725
  654. 28720 IF P5HTOT>99 THEN P5HTD = 3:GOTO 28725
  655. 28721 IF P5HTOT>9 THEN P5HTD = 2:GOTO 28725
  656. 28722 P5HTD = 1
  657. 28725 IF GMTOT=0 THEN CLS:PRINT"Sorry, ";TN$(X);" has no recorded rounds.":PRINT:PRINT:PRINT:GOTO 27000
  658. 28726 LPRINT"Player:  ";TN$(X)
  659. 28730 LPRINT"Games played:  "GMTOT
  660. 28740 LPRINT:LPRINT "Par 3 holes played: ";SPC(4-P3HTD)P3HTOT;SPC(15);:LPRINT USING "PAR 3 AVERAGE:###.##";P3AVG!
  661. 28750 LPRINT:LPRINT "Par 4 holes played: ";SPC(4-P4HTD)P4HTOT;SPC(15);:LPRINT USING "PAR 4 AVERAGE:###.##";P4AVG!
  662. 28760 LPRINT:LPRINT "Par 5 holes played: ";SPC(4-P5HTD)P5HTOT;SPC(15);:LPRINT USING "PAR 5 AVERAGE:###.##";P5AVG!
  663. 28770 GOTO 1000
  664. 28800 REM**************************************PRINT INDIVIDUAL PLAYER'S ROUNDS
  665. 28805 GOSUB 19010:IF K=0 THEN LOCATE 25,1:GOTO 27000
  666. 28806 R=0:FOR I=1 TO ROUNDS:GET #3,I
  667. 28809 IF PR<>CVI(N$) THEN 28875
  668. 28810 IF R = 0 THEN LPRINT TN$(PR):LPRINT:LPRINT"DATE         COURSE                        MONEY          FRONT    BACK   TOTAL":LPRINT
  669. 28815 RTOT=RTOT+1:GET #2,CVI(C$):LPRINT D$;SPC(5);COURSE$;SPC(2);
  670. 28830 IF CVI(M$)<-999 OR CVI(M$)>999 THEN LPRINT SPC(2);CVI(M$);:GOTO 28850
  671. 28835 IF CVI(M$)<-99 OR CVI(M$)>99 THEN LPRINT SPC(3);CVI(M$);:GOTO 28850
  672. 28840 IF CVI(M$)<-9 OR CVI(M$)>9 THEN LPRINT SPC(4);CVI(M$);:GOTO 28850
  673. 28845 LPRINT SPC(5);CVI(M$);
  674. 28850 FRONT = 0:BACK = 0:FOR H = 0 TO 8:FRONT = FRONT + CVI(S$(H)):NEXT H:FOR H = 9 TO 17:BACK = BACK + CVI(S$(H)):NEXT H
  675. 28855 LPRINT SPC(10)FRONT;SPC(4);BACK;
  676. 28860 IF FRONT + BACK >99 THEN LPRINT SPC(3);FRONT+BACK:GOTO 28870
  677. 28865 LPRINT SPC(4)FRONT+BACK
  678. 28870 R=1
  679. 28875 NEXT I
  680. 28880 IF R = O THEN CLS:PRINT"Sorry, ";TN$(PR);" has no recorded rounds.":PRINT:PRINT:PRINT:GOTO 27000
  681. 28885 GOTO 1000
  682. 28900 REM****************************************PRINT COURSE DATA
  683. 28905 OPEN "COURSPTR.DAT" FOR INPUT AS #1:INPUT #1,L
  684. 28915 CLOSE #1:IF L = 0 THEN CLS:PRINT"Sorry, there are no courses listed in our files.":LOCATE 25,1:GOTO 27000
  685. 28920 OPEN "COURSE.DAT" AS #2 LEN = 62
  686. 28925 FIELD #2,26 AS COURSE$,2 AS P$(1),2 AS P$(2),2 AS P$(3),2 AS P$(4),2 AS P$(5),2 AS P$(6),2 AS P$(7),2 AS P$(8),2 AS P$(9),2 AS P$(10),2 AS P$(11),2 AS P$(12),2 AS P$(13),2 AS P$(14),2 AS P$(15),2 AS P$(16),2 AS P$(17),2 AS P$(18)
  687. 28930 CLS:PRINT"Would you like to print a list of all courses?":PRINT"Please type `Y' or `N'. ";
  688. 28935 INPUT"",A$
  689. 28940 IF A$="Y" OR A$="y" THEN 28955
  690. 28945 IF A$ = "N" OR A$ = "n" THEN 29005
  691. 28950 BEEP:PRINT"Please type `Y' or `N'. ";:GOTO 28935
  692. 28955 CLS:LOCATE 10,30:PRINT"One moment please.....":LPRINT"COURSE";SPC(31);"FRONT PAR";SPC(5);"BACK PAR";SPC(10);"TOTAL PAR":LPRINT
  693. 28960 FOR I = 1 TO L:GET #2,I:FRONT=0:BACK=0:FOR H=1 TO 9:FRONT=FRONT+CVI(P$(H)):BACK=BACK+CVI(P$(H+9)):NEXT H:LPRINT COURSE$;SPC(15)FRONT;SPC(9)BACK;SPC(15)FRONT+BACK:NEXT I
  694. 29005 PRINT:PRINT:PRINT "Would you like to print detailed information about a course?":PRINT"Please type `Y' or `N': ";
  695. 29010 INPUT"",A$
  696. 29015 IF A$ = "Y" OR A$ = "y" THEN 29030
  697. 29020 IF A$ = "n" OR A$ = "N" THEN 1000
  698. 29025 BEEP:PRINT"Please type `Y' or `N'. ";:GOTO 29010
  699. 29030 CLS:CLOSE:GOSUB 23000:PRINT:PRINT:INPUT"Please enter the number of the course you would like to know about. ",COURSE
  700. 29040 IF COURSE <1 OR COURSE >L THEN PRINT"Wrong number.....please try again.":GOTO 20070
  701. 29045 CLS:LOCATE 10,30:PRINT"One moment please.....":GET #2,COURSE
  702. 29050 CORS$=COURSE$:FOR I=1 TO 18:P(I)=CVI(P$(I)):NEXT I:FP=0:BP=0:LPRINT CORS$:LPRINT
  703. 29090 LPRINT SPC(14);"HOLE";SPC(6);"PAR";SPC(27);"HOLE";SPC(6);"PAR"
  704. 29095 FOR I = 1 TO 9:FP = FP +P(I):BP=BP+P(I+9)
  705. 29100 LPRINT SPC(15)I;SPC(6)P(I);SPC(27)I+9;SPC(6)P(I+9)
  706. 29105 NEXT I
  707. 29110 LPRINT:LPRINT SPC(28);"Front Par:   ";FP
  708. 29115 LPRINT SPC(28);"Back Par:    ";BP
  709. 29120 LPRINT SPC(28);"Total Par:   ";FP+BP
  710. 29125 GOTO 1000
  711. 29200 REM****************************************PRINT GAME RESULTS
  712. 29205 CLS:PRINT"Please enter the date of the game to be printed":INPUT"using the form mm/dd/yy. ",DT$:GOSUB 13020
  713. 29208 IF G=0 OR L=0 THEN LOCATE 25,1:GOTO 27000
  714. 29210 PLYRS = G
  715. 29215 LPRINT COURSE$;"   (";FRONTP;"/";BACKP;"/";TOTP;")";SPC(27);DT$
  716. 29220 LPRINT:LPRINT"               Hole  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18  TOTAL";
  717. 29225 LPRINT:LPRINT"                Par ";:PARTOT = 0
  718. 29230 FOR I = 1 TO 18:LPRINT CVI(P$(I));:PARTOT = PARTOT + CVI(P$(I)):NEXT I:LPRINT "  ";PARTOT
  719. 29235 LPRINT:FOR M =1 TO PLYRS
  720. 29240 LPRINT TN$(PLYR(M));SPC(20-LEN(TN$(PLYR(M)))):TOT = 0:FOR I = 1 TO 18
  721. 29245 TOT = TOT + S(M,I)
  722. 29255 LPRINT S(M,I);
  723. 29256 NEXT I:IF TOT<100 THEN LPRINT" ";
  724. 29258 LPRINT " ";TOT:NEXT M:LPRINT
  725. 29260 FOR M = 1 TO PLYRS
  726. 29265 LPRINT TN$(PLYR(M));
  727. 29270 IF MONEY(M) = 0 THEN LPRINT" neither won nor lost any money.":GOTO 29305
  728. 29275 IF MONEY(M)<0 THEN 29290 ELSE LPRINT" won";MONEY(M);
  729. 29280 IF MONEY(M)<2 THEN LPRINT"dollar.":GOTO 29305
  730. 29285 LPRINT"dollars.":GOTO 29305
  731. 29290 LPRINT" lost";0-MONEY(M);
  732. 29295 IF MONEY(M)>-2 THEN LPRINT"dollar.":GOTO 29305
  733. 29300 LPRINT"dollars."
  734. 29305 NEXT M
  735. 29310 GOTO 1000
  736. 29400 REM*******************************PRINT ALL PLAYERS' HOLE AVERAGES BY PAR
  737. 29405 GOSUB 30105
  738. 29410 LPRINT"PLAYER'S";SPC(7);"GAMES";SPC(4);"PAR 3'S";SPC(2);"PAR 3";SPC(6);"PAR 4'S";SPC(2);"PAR 4";SPC(6);"PAR 5'S";SPC(2);"PAR 5";
  739. 29415 LPRINT"NAME";SPC(11);"PLAYED";SPC(3);"PLAYED";SPC(3);"AVERAGE";SPC(4);"PLAYED";SPC(3);"AVERAGE";SPC(4);"PLAYED";SPC(3);"AVERAGE"
  740. 29420 FOR PL = 1 TO K:LPRINT TN$(PL);SPC(16-LEN(TN$(PL)));
  741. 29425 IF GMTOT(PL)<10 THEN LPRINT"  ";:GOTO 29435
  742. 29430 IF GMTOT(PL) <100 THEN LPRINT " ";
  743. 29435 LPRINT GMTOT(PL);SPC(4);
  744. 29440 IF P3HTOT(PL)<10 THEN LPRINT"   ";:GOTO 29455
  745. 29445 IF P3HTOT(PL)<100 THEN LPRINT"  ";:GOTO 29455
  746. 29450 IF P3HTOT(PL)<1000 THEN LPRINT" ";
  747. 29455 LPRINT P3HTOT(PL);SPC(3);:LPRINT USING"##.##";P3AVG!(PL);:LPRINT SPC(6);
  748. 29460 IF P4HTOT(PL)<10 THEN LPRINT"   ";:GOTO 29475
  749. 29465 IF P4HTOT(PL)<100 THEN LPRINT"  ";:GOTO 29475
  750. 29470 IF P4HTOT(PL)<1000 THEN LPRINT" ";
  751. 29475 LPRINT P4HTOT(PL);SPC(3);:LPRINT USING"##.##";P4AVG!(PL);:LPRINT SPC(6);
  752. 29480 IF P5HTOT(PL)<10 THEN LPRINT"   ";:GOTO 29495
  753. 29485 IF P5HTOT(PL)<100 THEN LPRINT"  ";:GOTO 29495
  754. 29490 IF P5HTOT(PL)<1000 THEN LPRINT" ";
  755. 29495 LPRINT P5HTOT(PL);SPC(3);:LPRINT USING"##.##";P5AVG!(PL):NEXT PL:GOTO 1000
  756. 30000 REM****************************************DISPLAY GAME RESULTS
  757. 30010 CLS:PRINT"Please enter the date of the game to be displayed":INPUT"using the form mm/dd/yy. ",DT$:GOSUB 13020
  758. 30020 IF L=0 THEN LOCATE 25,1:GOTO 27000
  759. 30025 PLYRS=G:GOSUB 7605
  760. 30030 LOCATE 25,1:GOTO 27000
  761. 30100 REM*****************************DISPLAY ALL PLAYERS' HOLE AVERAGES BY PAR
  762. 30102 GOSUB 30105:GOTO 30225
  763. 30105 CLS:LOCATE 10,30:PRINT"One moment please.....":GOSUB 22010:IF K=0 THEN LOCATE 25,1:GOTO 27000
  764. 30120 OPEN "COURSE.DAT" AS #2 LEN = 62
  765. 30125 FIELD #2,26 AS COURSE$,2 AS P$(1),2 AS P$(2),2 AS P$(3),2 AS P$(4),2 AS P$(5),2 AS P$(6),2 AS P$(7),2 AS P$(8),2 AS P$(9),2 AS P$(10),2 AS P$(11),2 AS P$(12),2 AS P$(13),2 AS P$(14),2 AS P$(15),2 AS P$(16),2 AS P$(17),2 AS P$(18)
  766. 30126 OPEN "roundptr.dat" FOR INPUT AS #1:INPUT #1,ROUNDS:CLOSE #1:OPEN "round.dat" AS #3 LEN=59
  767. 30129 FIELD #3,8 AS D$,5 AS N$,5 AS C$,5 AS M$,2 AS S$(0),2 AS S$(1),2 AS S$(2),2 AS S$(3),2 AS S$(4),2 AS S$(5),2 AS S$(6),2 AS S$(7),2 AS S$(8),2 AS S$(9),2 AS S$(10),2 AS S$(11),2 AS S$(12),2 AS S$(13),2 AS S$(14),2 AS S$(15),2 AS S$(16),2 AS S$(17)
  768. 30130 FOR PL = 1 TO K:GMTOT(PL)=0:P3HTOT(PL)=0:P3STOT(PL)=0:P4HTOT(PL)=0:P4STOT(PL)=0:P5HTOT(PL)=0:P5STOT(PL)=0:NEXT PL:FOR I=1 TO ROUNDS
  769. 30150 GET #3,I:PL=CVI(N$)
  770. 30155 GET #2,CVI(C$):IF INSTR(COURSE$,CC$)<>0 THEN 30186
  771. 30160 GMTOT(PL)=GMTOT(PL)+1:FOR H=1 TO 18
  772. 30170 IF CVI(P$(H)) = 3 THEN P3STOT(PL)=P3STOT(PL)+CVI(S$(H-1)):P3HTOT(PL)= P3HTOT(PL)+1:GOTO 30182
  773. 30175 IF CVI(P$(H)) = 4 THEN P4STOT(PL)=P4STOT(PL)+CVI(S$(H-1)):P4HTOT(PL)= P4HTOT(PL)+1:GOTO 30182
  774. 30180 P5STOT(PL) = P5STOT(PL)+CVI(S$(H-1)):P5HTOT(PL) = P5HTOT(PL)+1
  775. 30182 NEXT H
  776. 30186 NEXT I:FOR PL = 1 TO K
  777. 30190 IF P3HTOT(PL)<>0 THEN P3AVG!(PL) = P3STOT(PL)/P3HTOT(PL):GOTO 30200
  778. 30195 P3AVG!(PL) = 0
  779. 30200 IF P4HTOT(PL)<>0 THEN P4AVG!(PL) = P4STOT(PL)/P4HTOT(PL):GOTO 30210
  780. 30205 P4AVG!(PL) = 0
  781. 30210 IF P5HTOT(PL)<>0 THEN P5AVG!(PL) = P5STOT(PL)/P5HTOT(PL):GOTO 30217
  782. 30215 P5AVG!(PL) = 0
  783. 30217 NEXT PL
  784. 30220 RETURN
  785. 30225 S=0:IF K>20 THEN L=20 ELSE L=K
  786. 30229 CLS:PRINT"PLAYER'S";SPC(7);"GAMES";SPC(4);"PAR 3'S";SPC(2);"PAR 3";SPC(6);"PAR 4'S";SPC(2);"PAR 4";SPC(6);"PAR 5'S";SPC(2);"PAR 5";
  787. 30230 PRINT"NAME";SPC(11);"PLAYED";SPC(3);"PLAYED";SPC(3);"AVERAGE";SPC(4);"PLAYED";SPC(3);"AVERAGE";SPC(4);"PLAYED";SPC(3);"AVERAGE"
  788. 30231 LOCATE 4,1
  789. 30235 FOR PL=S+1 TO L:PRINT TN$(PL);SPC(18-LEN(TN$(PL)));
  790. 30240 IF GMTOT(PL)<10 THEN 30250
  791. 30245 PRINT CHR$(29);:IF GMTOT(PL) >99 THEN PRINT CHR$(29);
  792. 30250 PRINT GMTOT(PL);SPC(7);
  793. 30262 IF P3HTOT(PL)<10 THEN 30268
  794. 30264 PRINT CHR$(29);:IF P3HTOT(PL)<100 THEN 30268
  795. 30266 PRINT CHR$(29);:IF P3HTOT(PL)>999 THEN PRINT CHR$(29);
  796. 30268 PRINT P3HTOT(PL);SPC(3);:PRINT USING"##.##";P3AVG!(PL);:PRINT SPC(9);
  797. 30272 IF P4HTOT(PL)<10 THEN 30278
  798. 30274 PRINT CHR$(29);:IF P4HTOT(PL)<100 THEN 30278
  799. 30276 PRINT CHR$(29);:IF P4HTOT(PL)>999 THEN PRINT CHR$(29);
  800. 30278 PRINT P4HTOT(PL);SPC(3);:PRINT USING"##.##";P4AVG!(PL);:PRINT SPC(9);
  801. 30282 IF P5HTOT(PL)<10 THEN 30290
  802. 30284 PRINT CHR$(29);:IF P5HTOT(PL)<100 THEN 30290
  803. 30286 PRINT CHR$(29);:IF P5HTOT(PL)>999 THEN PRINT CHR$(29);
  804. 30290 PRINT P5HTOT(PL);SPC(3);:PRINT USING"##.##";P5AVG!(PL):NEXT PL
  805. 30292 LOCATE 25,1:IF L=K THEN 27000
  806. 30294 PRINT"Press any key to continue...";
  807. 30296 A$=INKEY$
  808. 30298 IF A$="" THEN 30296
  809. 30300 L=K:S=20:GOTO 30229
  810. 32000 END
  811. 33000 CLS:LOCATE 10,1:IF ERR=53 THEN PRINT"Diskette contains no data.  Please initialize.":GOTO 33100
  812. 33010 IF ERR=24 OR ERR=25 OR ERR=27 THEN PRINT"Check printer before continuing.":GOTO 33100
  813. 33020 PRINT"Someting is wrong.":PRINT"I don't know what it is.":PRINT"Try again.":PRINT"Pray."
  814. 33100 LOCATE 25,1:PRINT"Press any key to continue...";
  815. 33110 A$=INKEY$:IF A$="" THEN 33110
  816. 33120 RESUME 1000
  817.